/**把驼峰编程下划线*/
function camelToUnderline (str: string, seprator = '_'): string {
  let arr: string[] = str.split('')
  arr.forEach((char, index) => {
    if (char.charCodeAt(0) <= 90 && char.charCodeAt(0) >= 65) {
      arr[ index ] = seprator + char.toLowerCase()
    }
  })
  return arr.join('')
}

export default camelToUnderline
